package com.ruoyi.review.service.impl;

import java.util.List;

import com.ruoyi.common.constant.SysConstants;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.review.mapper.SysInterflowMapper;
import com.ruoyi.review.domain.SysInterflow;
import com.ruoyi.review.service.ISysInterflowService;

/**
 * 问答Service业务层处理
 * 
 * @author YJF
 * @date 2023-05-08
 */
@Service
public class SysInterflowServiceImpl implements ISysInterflowService 
{
    @Autowired
    private SysInterflowMapper sysInterflowMapper;

    /**
     * 查询问答
     * 
     * @param interflowId 问答主键
     * @return 问答
     */
    @Override
    public SysInterflow selectSysInterflowByInterflowId(Long interflowId)
    {
        return sysInterflowMapper.selectSysInterflowByInterflowId(interflowId);
    }

    /**
     * 查询问答列表
     * 
     * @param sysInterflow 问答
     * @return 问答
     */
    @Override
    public List<SysInterflow> selectSysInterflowList(SysInterflow sysInterflow)
    {
        sysInterflow.setDelFlag(SysConstants.CONSTANT_STR0);
        return sysInterflowMapper.selectSysInterflowList(sysInterflow);
    }

    /**
     * 新增问答
     * 
     * @param sysInterflow 问答
     * @return 结果
     */
    @Override
    public int insertSysInterflow(SysInterflow sysInterflow)
    {
        sysInterflow.setCreateTime(DateUtils.getNowDate());
        return sysInterflowMapper.insertSysInterflow(sysInterflow);
    }

    /**
     * 修改问答
     * 
     * @param sysInterflow 问答
     * @return 结果
     */
    @Override
    public int updateSysInterflow(SysInterflow sysInterflow)
    {
        return sysInterflowMapper.updateSysInterflow(sysInterflow);
    }

    /**
     * 批量删除问答
     * 
     * @param interflowIds 需要删除的问答主键
     * @return 结果
     */
    @Override
    public int deleteSysInterflowByInterflowIds(Long[] interflowIds)
    {
        return sysInterflowMapper.deleteSysInterflowByInterflowIds(interflowIds);
    }

    /**
     * 删除问答信息
     * 
     * @param interflowId 问答主键
     * @return 结果
     */
    @Override
    public int deleteSysInterflowByInterflowId(Long interflowId)
    {
        return sysInterflowMapper.deleteSysInterflowByInterflowId(interflowId);
    }
}
